package org.lhq.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.lhq.entity.User;
import org.lhq.entity.UserFile;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: admin-service
 * @description: 管理员文件管理
 * @author: Wang defa
 * @create: 2021-01-05 11:37
 */

@FeignClient(name = "file-service")
@RequestMapping("file-feign")
public interface FileService {
    @PostMapping("save")
    Boolean saveUserFile(@RequestBody UserFile userFile);
    @PostMapping("delete")
    Boolean deleteUserFileById(@RequestParam("id") Long id);
    @GetMapping("{id}")
    UserFile getUserFileById(@PathVariable("id") Long id);
    @GetMapping("user/{userId}")
    List<UserFile> getUserFileListByUserId(@PathVariable("userId") Long userId);
    @PostMapping("update")
    Boolean updateUserById(UserFile userFile);

    @PostMapping("batchDeleteTable")
    Boolean batchDeleteTable(@RequestParam("ids") List<Long> ids);
    /**
     * 分页查找
     * @param user
     * @param size
     * @param pageNum
     * @return
     */
    @PostMapping("page")
    Page<UserFile> getUserPage(@RequestBody UserFile file,
                           @RequestParam Long size,
                           @RequestParam Long pageNum);
}
